package com.cms.dao.mapper;

import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.cms.common.annotation.RecordLog;
import com.cms.exception.SystemDBException;
import com.cms.model.ActivityCommission;
import com.cms.model.TrUser;

public interface MemberUserMapper {

	 /***
	  * 
	  * @param user
	  * @throws Exception
	  */
	 @RecordLog(expression="更改用户[${id}]${userName}用户状态",name="uid",catalog="memberInfo")
	 public void changeUserStatus(@Param("user")TrUser user)throws SystemDBException;
	 
	 /***
	  * 添加会员
	  * @param user
	  * @throws SystemDBException
	  */
	 @RecordLog(expression="添加用户[${userName}]",name="userName",catalog="memberInfo")
	 public void registerUser(@Param("user")TrUser user)throws SystemDBException;
	 
	 
	 /***
	  * 编辑会员数据
	  * @param user
	  * @throws SystemDBException
	  */
	 @RecordLog(expression="修改用户[${id}]${userName}信息",name="uid",catalog="memberInfo")
	 public void updateUserInfo(@Param("user")TrUser user)throws SystemDBException;
	 
	 
	 /***
	  * 更新用户的账户余额
	  * @param user
	  * @throws SystemDBException
	  */
	 @RecordLog(expression="管理员为${userName}[${id}]充值${coin}",name="uid",catalog="managerRecharge")
     public void reCharge(@Param("user")TrUser user) throws SystemDBException;
	 
	 /***
	  * 更新用户的账户余额
	  * @param user
	  * @throws SystemDBException
	  */
	 @RecordLog(expression="管理员为${userName}[${id}]提现确认${coin}",name="uid",catalog="cashConfirm")
	 public void handlerUserCash(@Param("user")TrUser user) throws SystemDBException;
	 
	 /***
	  * 更新用户的账户余额
	  * @param user
	  * @throws SystemDBException
	  */
	 @RecordLog(expression="管理员为${userName}[${id}]充值确认${coin}",name="uid",catalog="chargeConfirm")
	 public void handlerUserCharge(@Param("user")TrUser user) throws SystemDBException;
	 
	 
     /***
      * 
      * @param uid
      * @return
      * @throws Exception
      */
	 public TrUser getUserInfoById(@Param("id")int uid) throws SystemDBException;
	 
	 
	 /***
	  *  根据用户id获取用户会员信息
	  * @param uid
	  * @return
	  * @throws SystemDBException
	  */
	 public TrUser getUserInfoByUid(@Param(value="uid")String uid)throws SystemDBException;
	 
	 
	 /**
	  * 根据登录名查询是否存在当前用户
	  * @param loginName
	  * @return
	  * @throws SystemDBException
	  */
	 public TrUser getUserInfoByLoginName(@Param(value="loginName")String loginName)throws SystemDBException;
	 
	 
	 /***
	  *  保存用户的活动佣金
	  * @param commission
	  * @throws SystemDBException
	  */
     public void saveActivityCommission(@Param("commission")ActivityCommission commission)throws SystemDBException;
     
     
	 /***
	  *  删除用户的活动佣金
	  * @param commission
	  * @throws SystemDBException
	  */
     public void deleteActivityCommission(@Param("commission")ActivityCommission commission)throws SystemDBException;
     
     
     /***
      *  删除用户的投注记录
      * @param content
      * @throws SystemDBException
      */
     public void deleteBetComm(@Param("betComm")Map<String, Object> content)throws SystemDBException;
     
     
 	public void setUserOffline() throws SystemDBException;
}
